﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Takkou.Language
{
    public class NumberAssignment : Statement
    {
        public NumberVar Variable { get; private set; }
        public Number Value { get; private set; }

        public NumberAssignment(NumberVar v, Number num)
        {
            Variable = v;
            Value = num;
        }

        public override bool execute()
        {
            Variable.Value = new ValNumber(Value.get());
            return false;  // false means that the command has finished
        }
    }

    public class StringAssignment : Statement
    {
        public StringVar Variable { get; private set; }
        public String Value { get; private set; }

        public StringAssignment(StringVar v, String num)
        {
            Variable = v;
            Value = num;
        }

        public override bool execute()
        {
            Variable.Value = Value;
            return true;
        }
    }
}
